<template>
    <div class="update-name">
        <!-- 导航栏 -->
        <van-nav-bar 
            title="修改昵称"
            left-text="取消"
            right-text="完成"
            @click-left="$emit('close')"
            @click-right="onClickRight"
        />
        <!-- /导航栏 -->
        <van-field
            class="name-field-wrap"
            v-model="localName"
            rows="2"
            autosize
            type="textarea"
            maxlength="7"
            placeholder="请输入名称"
            show-word-limit
        />
    </div>
</template>
<script>
import { updateUserprofile } from '@/api/user'
export default {
    props:{
        
    },
    data() {
        return {
            localName:'有点666'
        }
    },
    methods: {
        
        async onClickRight(){
            this.$toast.loading({
                message:'保存中',
                forbidclick:true
            })
            this.$toast.success('保存成功')
            this.$emit('close')
            
            /*const { data } = await updateUserprofile({
                name:this.localName
            })*/
            //console.log(data)
        }
    }
    
}
</script>
<style lang="less" scoped>
.name-field-wrap{
    padding: 10px;
}
</style>